// AutoEnumString.h: interface for the CAutoEnumString class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AUTOENUMSTRING_H__14812C31_DA2E_4C0F_8BB7_F0EA89B11C3A__INCLUDED_)
#define AFX_AUTOENUMSTRING_H__14812C31_DA2E_4C0F_8BB7_F0EA89B11C3A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <AtlConv.h>
#include <ShlObj.h>

class CAutoEnumString : public IEnumString  
{
public:
	//IUnKnow interface
	virtual HRESULT __stdcall  QueryInterface(const IID& iid, void **ppv);
	virtual ULONG __stdcall Release();
	virtual ULONG __stdcall AddRef();


	//IEnumString interface
	virtual HRESULT __stdcall Next(ULONG celt, LPOLESTR* rgelt, ULONG* pceltFetched);
	virtual HRESULT __stdcall Reset();
	virtual HRESULT __stdcall Skip(ULONG celt);
	virtual HRESULT __stdcall Clone(IEnumString** ppEnum);

	int AddString(LPCSTR lpszStr);
	CAutoEnumString();
	virtual ~CAutoEnumString();

	HRESULT Copy(LPOLESTR* p1, LPOLESTR* p2);

protected:
	CStringArray m_arString;
	int m_iterCur;

private:
	int		m_Ref ;
};

#endif // !defined(AFX_AUTOENUMSTRING_H__14812C31_DA2E_4C0F_8BB7_F0EA89B11C3A__INCLUDED_)
